import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class FirstPageScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return ElevatedButton(
        onPressed: () {
          //Navigator.push(
           //   context, MaterialPageRoute(builder: (context) => SecondPageScreen()));
          Navigator.pushNamed(context, "second_page");
        },
        child: Text("next 22"));
  }
}

class SecondPageScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return RaisedButton(onPressed: () => Navigator.pop(context),child: Text("Back"),);
  }
}
